'DRAWMODE(1):REQUEST("Do you want to fill the table?")'
if result=1 then do
'DEF OR(A,B)=IF(A+B,1,0)'
'DEF AND(A,B)=IF(A*B,1,0)'
'DEF NOT(A)=IF(A,0,1)'
'DEF NAND(A,B)=NOT(AND(A,B))'
'DEF NOR(A,B)=NOT(OR(A,B))'
'DEF XOR(A,B)=IF(A+B==1,1,0)'
do i=1 to nbs
'ASK("'nomS.i' equation?"+CHR(10)+"You can use the"+CHR(10)+"functions NOT(A),"+CHR(10)+"AND(A,B), OR(A,B), XOR(A,B)"+CHR(10)+"NAND(A,B) et NOR(A,B)."+CHR(10)+"Use the variable names like"+CHR(10)+"you gave them for inputs.")'
eq=result
if eq~= "" then do
do ligne=1 to nbl
do j=1 to nbe
'EXEC("'nomE.j'='val.j.ligne'")'
end
'EXEC("'eq'")'; r=result
'MARK(WRITE("'r'",'cols.i','20+ligne*15'))'
end
end
end
end
exit
syntax:
erreur=RC
'MESSAGE("Script TruthTable"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
'MESSAGE("Script TruthTable"+CHR(10)+"Error in line 'SIGL'")'